
import { ApiProperty, PartialType, PickType } from '@nestjs/swagger';
import {
    CntrLeaseDto,
    CreateCntrDto,
    InPlanDto,
    LeasePlanDto,
    OutPlanDto,
    PlanCntrDto,
    PlanDto,
    PlanFeedetDto,
    RentPlanDto,
} from './create-container.dto';
import { IsNotEmpty, IsNumber } from 'class-validator';

export class UpdateCntrDto extends PartialType(CreateCntrDto) {
    @IsNumber(
        {},
        {
            message: '缺少id',
        },
    )
    @ApiProperty({
        example: 0,
        type: 'int',
    })
    id: number;
    
    out_truck_sn?: number;
    release_no?: string;
    leav_port_tim?: Date;
    
}
export class UpdatePlanDto extends PartialType(PlanDto) {
    @IsNumber(
        {},
        {
            message: '缺少id',
        },
    )
    @ApiProperty({
        example: 0,
        type: 'int',
    })
    id: number;

    @IsNotEmpty({
        message: '已生成费用同步修改标识不能为空'
    })
    updateFeeFlag: boolean;
}
export class UpdateInPlanDto extends PartialType(InPlanDto) {
    @IsNumber(
        {},
        {
            message: '缺少id',
        },
    )
    @ApiProperty({
        example: 0,
        type: 'int',
    })
    id: number;

    @IsNotEmpty({
        message: '已生成费用同步修改标识不能为空'
    })
    updateFeeFlag: boolean;
}
export class UpdateOutPlanDto extends OutPlanDto {
    @IsNumber(
        {},
        {
            message: '缺少id',
        },
    )
    @ApiProperty({
        example: 0,
        type: 'int',
    })
    id: number;
    @IsNotEmpty({
        message: '已生成费用同步修改标识不能为空'
    })
    updateFeeFlag: boolean;
    
}
export class UpdateTransPlanDto extends PlanDto {
    @IsNumber(
        {},
        {
            message: '缺少id',
        },
    )
    @ApiProperty({
        example: 0,
        type: 'int',
    })
    id: number;
    @IsNotEmpty({
        message: '已生成费用同步修改标识不能为空'
    })
    updateFeeFlag: boolean;
}
export class UpdateLeasePlanDto extends PartialType(LeasePlanDto) {
    @IsNumber(
        {},
        {
            message: '缺少id',
        },
    )
    @ApiProperty({
        example: 0,
        type: 'int',
    })
    id: number;
    @IsNotEmpty({
        message: '已生成费用同步修改标识不能为空'
    })
    updateFeeFlag: boolean;
}
export class UpdateRentPlanDto extends PartialType(RentPlanDto) {
    @IsNumber(
        {},
        {
            message: '缺少id',
        },
    )
    @ApiProperty({
        example: 0,
        type: 'int',
    })
    id: number;
    @IsNotEmpty({
        message: '已生成费用同步修改标识不能为空'
    })
    updateFeeFlag: boolean;
}
export class UpdatePlanFeeDto extends PartialType(PlanFeedetDto) {
    @IsNumber(
        {},
        {
            message: '缺少id',
        },
    )
    @ApiProperty({
        example: 0,
        type: 'int',
    })
    id: number;
}

export class UpdatePlanCntrDto extends PartialType(PlanCntrDto) {
    @IsNumber(
        {},
        {
            message: '缺少id',
        },
    )
    id: number;
}
export class QueryPlanPreCntrDto extends PickType(PlanCntrDto, ['truck_sn']) {}
export class UpdateLeaseCntrDto extends PickType(CntrLeaseDto, [
    'out_date',
    'out_truck_no_c',
    'out_driver_tel',
    'back_date',
]) {
    @IsNumber(
        {},
        {
            message: '缺少id',
        },
    )
    @ApiProperty({
        example: 0,
        type: 'int',
    })
    id: number;
}

export class LeaseCntrBackDto extends PickType(CntrLeaseDto, ['rent_sn', 'back_date', 'back_driver_tel', 'back_truck_no_c',  'back_cfs']) {
    @IsNumber(
        {},
        {
            message: '缺少id',
        },
    )
    id: number;
}